﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SlickGridNet.Utils;

namespace SlickGridNet_UnitTest
{
	[TestClass]
	public class StringUtilsUnitTest
	{
		[TestMethod]
		public void IsIdentifierTest()
		{
			const string
				correctValue1 = "_myIdentifier123",
				correctValue2 = "_",
				correctValue3 = "a";
			const string
				incorrectValue1 = "1",
				incorrectValue2 = "q$123",
				incorrectValue3 = "a b",
				incorrectValue4 = "факинШит";

			Assert.IsTrue(StringUtils.IsIdentifier(correctValue1));
			Assert.IsTrue(StringUtils.IsIdentifier(correctValue2));
			Assert.IsTrue(StringUtils.IsIdentifier(correctValue3));

			Assert.IsFalse(StringUtils.IsIdentifier(incorrectValue1));
			Assert.IsFalse(StringUtils.IsIdentifier(incorrectValue2));
			Assert.IsFalse(StringUtils.IsIdentifier(incorrectValue3));
			Assert.IsFalse(StringUtils.IsIdentifier(incorrectValue4));
		}
	}
}
